//
//  RegisterFooterView.m
//  WeiYiMei
//
//  Created by 李叶夫 on 2019/4/14.
//  Copyright © 2019年 liyefu. All rights reserved.
//

#import "RegisterFooterView.h"
#import "ANGradientButton.h"

@implementation RegisterFooterView

- (void)setupSubViews
{
    self.backgroundColor = [UIColor clearColor];
    
    ANGradientButton *btn1 = [[ANGradientButton alloc] initWithFrame:CGRectMake(0, 0, kScreenW-kWidth(30), kWidth(48))];
    [btn1 setTitle:@"注册为微会员" forState:UIControlStateNormal];
    [btn1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    btn1.titleLabel.font = [UIFont systemFontOfSize:17];
    
//    ANGradientButton *btn2 = [[ANGradientButton alloc] initWithFrame:CGRectMake(0, 0, kScreenW-30, 48)];
//    [btn2 setTitle:@"注册为正式会员" forState:UIControlStateNormal];
//    [btn2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
//    btn2.titleLabel.font = [UIFont systemFontOfSize:17];
    
    [self addSubview:btn1];
//    [self addSubview:btn2];
    
    btn1.layer.cornerRadius = kWidth(24);
    btn1.layer.masksToBounds = YES;
//    btn2.layer.cornerRadius = 24;
//    btn2.layer.masksToBounds = YES;
    
    [btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(kWidth(15));
        make.right.equalTo(self).offset(-kWidth(15));
        make.height.equalTo(@(kWidth(48)));
        make.bottom.equalTo(self).offset(-kWidth(10));
    }];
    
//    [btn2 mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.equalTo(self).offset(15);
//        make.right.equalTo(self).offset(-15);
//        make.height.equalTo(@48);
//        make.bottom.equalTo(self).offset(-10);
//    }];
    
    [btn1 addTarget:self action:@selector(clickAction1:) forControlEvents:UIControlEventTouchUpInside];
//    [btn2 addTarget:self action:@selector(clickAction2:) forControlEvents:UIControlEventTouchUpInside];
}

- (void)clickAction1:(id)sender
{
    if (self.weiVipHandler) {
        self.weiVipHandler();
    }
}

//- (void)clickAction2:(id)sender
//{
//    if (self.VipHandler) {
//        self.VipHandler();
//    }
//}

@end
